 /***************************************************************************
 *   Copyright (C) 2009 by stefan,,,                                       *
 *   stefan.w.ggb@gmail.com                                                *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

 /* Entry for double linked list */
 struct DEntry {
	 struct DEntry *previous;
	 struct DEntry *next;
	 char *data;
 };
 
 /* Double Linked List */
 struct DLinkedList {
	 int (*deleteDLinkedList)(struct DLinkedList*);
	 int (*addElement)(struct DLinkedList*, char*);
	 int (*addFirst)(struct DLinkedList*, char*);
	 int (*addLast)(struct DLinkedList*, char*);
	 int (*addAtPosition)(struct DLinkedList*, int, char*);
	 char* (*removeElement)(struct DLinkedList*, char*);
	 char* (*removeFirst)(struct DLinkedList*);
	 char* (*removeLast)(struct DLinkedList*);
	 char* (*removeAtPosition)(struct DLinkedList*, int);
	 char* (*getElement)(struct DLinkedList*, int);
	 char* (*getFirst)(struct DLinkedList*);
	 char* (*getLast)(struct DLinkedList*);	 
	 int (*indexOf)(struct DLinkedList*, char*);
	 int (*getSize)(struct DLinkedList*);
	 int size;
	 struct DEntry *dummy;
 };
 
typedef struct DLinkedList* DoubleLinkedList;
 
struct DLinkedList* createDLinkedList();
int _swr_list_deleteDLinkedList(struct DLinkedList*);
int _swr_list_addElement(struct DLinkedList*, char*);
int _swr_list_addFirst(struct DLinkedList*, char*);
int _swr_list_addLast(struct DLinkedList*, char*);
int _swr_list_addAtPosition(struct DLinkedList*, int, char*);
char* _swr_list_removeElement(struct DLinkedList*, char*);
char* _swr_list_removeFirst(struct DLinkedList*);
char* _swr_list_removeLast(struct DLinkedList*);
char* _swr_list_removeAtPosition(struct DLinkedList*, int);
char* _swr_list_getElement(struct DLinkedList*, int);
char* _swr_list_getFirst(struct DLinkedList*);
char* _swr_list_getLast(struct DLinkedList*);
int _swr_list_indexOf(struct DLinkedList*, char*);
int _swr_list_getSize(struct DLinkedList*);
struct DEntry* _swr_list_getEntry(struct DLinkedList*, int);
